package rtsp

import (
	"github.com/gin-gonic/gin"
	"local_rtsp_play/model"
)

func Pull(c *gin.Context) {
	targetURL := c.Query("target")
	streamPath := c.Query("streamPath")
	if err := new(model.RTSP).PullStream(streamPath, targetURL); err == nil {
		c.JSON(200, gin.H{
			"code": 0,
		})
	} else {
		c.JSON(200, gin.H{
			"code": 1,
			"msg":  err.Error(),
		})
	}
}
